"use strict";
var __extends =
  (this && this.__extends) ||
  (function () {
    var extendStatics = function (d, b) {
      extendStatics =
        Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array &&
          function (d, b) {
            d.__proto__ = b;
          }) ||
        function (d, b) {
          for (var p in b)
            if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
        };
      return extendStatics(d, b);
    };
    return function (d, b) {
      if (typeof b !== "function" && b !== null)
        throw new TypeError(
          "Class extends value " + String(b) + " is not a constructor or null"
        );
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype =
        b === null
          ? Object.create(b)
          : ((__.prototype = b.prototype), new __());
    };
  })();
console.log(1212);
function getadd(name, age) {
  if (age === void 0) {
    age = 20;
  }
  console.log(age);
  return name;
}
getadd("1");
function tsChong(str) {
  if (typeof str === "string") {
    console.log(str + "字符串");
  } else {
    console.log(str + "数字");
  }
}
tsChong(1, 1);
// ts 定义类的方法
var Person = /** @class */ (function () {
  function Person(n) {
    this.name = n;
  }
  Person.prototype.run = function () {
    console.log(this.name);
  };
  return Person;
})();
var a = new Person("刘涵");
a.run();
console.log(a.name);
// ts 继承 关键字 extends 和 super 两个关键词
var Web = /** @class */ (function (_super) {
  __extends(Web, _super);
  function Web(name) {
    return _super.call(this, name) || this;
  }
  return Web;
})(Person);
var w = new Web("张三");
w.run();
/**
 * name
 */
// public name() {
// }
//protected (自身还有子应用可以访问的属性) private (私有的 有且只有自己可以访问的属性) public (公有的 都可以访问)
// ts 的静态方法
var per = /** @class */ (function () {
  function per(name) {
    this.name = name;
  }
  per.text = function () {
    console.log(this.sex);
  };
  per.sex = "男";
  return per;
})();
per.text();
// 抽象类 abstract (关键字) 抽象类无法直接被实例化 --- 是用来定义标准的
var abs = /** @class */ (function () {
  function abs(name) {
    this.name = name;
  }
  return abs;
})();
var Wp = /** @class */ (function (_super) {
  __extends(Wp, _super);
  function Wp(na) {
    return _super.call(this, na) || this;
  }
  Wp.prototype.rea = function () {
    console.log(this.name);
  };
  return Wp;
})(abs);
var me = new Wp("我是刘涵");
me.rea();
console.log(1);
